from django.contrib import admin
from django.urls import path
from app01.views import user, depart, admin, record, account, chart

urlpatterns = [
    # path("admin/", admin.site.urls),

    path('', chart.chart_list_7),
    # 部门管理
    path('depart/list/', depart.depart_list),
    path('depart/add/', depart.depart_add),
    path('depart/delete/', depart.depart_delete),
    path('depart/<int:nid>/edit/', depart.depart_edit),

    # 用户管理
    path('user/list/', user.user_list),
    path('user/add/', user.user_add),
    path('user/delete/', user.user_delete),
    path('user/<int:nid>/edit/', user.user_edit),
    path('info/list/', user.info_list),

    # 管理员的管理
    path('admin/list/', admin.admin_list),
    path('admin/add/', admin.admin_add),
    path('admin/<int:nid>/edit/', admin.admin_edit),
    path('admin/delete/', admin.admin_delete),
    path('admin/<int:nid>/reset/', admin.admin_reset),
    path('admin/<int:nid>/level/', admin.admin_level),
    path('info/list/admin/', admin.info_list),

    # 登录
    path('login/', account.login),
    path('logout/', account.logout),
    path('image/code/', account.image_code),

    # 签到记录
    path('record/list/', record.record_list),
    path('record/add/', record.record_add),
    path('record/<int:nid>/edit/', record.record_edit),
    path('record/delete/', record.record_delete),
    path('record/add/day/', record.record_add_day),
    path('record/download/excel/', record.data_to_excel),


    # 数据统计
    path('chart/list/7/', chart.chart_list_7),
    path('chart/bar/7/', chart.chart_bar_7),
    path('chart/pie/7/', chart.chart_pie_7),
    path('chart/line/7/', chart.chart_line_7),
    path('chart/list/30/', chart.chart_list_30),
    path('chart/bar/30/', chart.chart_bar_30),
    path('chart/pie/30/', chart.chart_pie_30),
    path('chart/line/30/', chart.chart_line_30),

]
